<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/4/19
  Time: 13:00
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<style>
    h1 small {
        background: palevioletred;
        color: white;
        font-size: 60px;
        font-weight: bold;
        border-radius: 5px;
    }

    th {
        color: #dc143c;
        font-size: 21px;
    }
</style>
<head>
    <title>查询全部</title>
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
</head>
<body background="resources/images/22.jpg">
<div class="container">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <div class="page-header">
                <h1>
                    <small>汽车列表 —— 显示所有汽车</small>
                </h1>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-md-4 column">
            <a class="btn btn-primary" href="${pageContext.request.contextPath}/addCars">新增</a>
            <a class="btn btn-primary" href="${pageContext.request.contextPath}/select">查询</a>
        </div>
    </div>

    <div class="row clearfix">
        <div class="col-md-12 column">
            <table class="table table-hover table-striped">
                <thead>
                <tr>
                    <th>汽车编号</th>
                    <th>汽车名字</th>
                    <th>汽车价格</th>
                    <th>汽车数量</th>
                    <th>汽车详情</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <c:forEach var="car" items="${car}">
                    <tr>
                        <td>${car.id}</td>
                        <td>${car.name}</td>
                        <td>${car.price}</td>
                        <td>${car.count}</td>
                        <td>${car.detail}</td>
                        <td>
                            <a href="${pageContext.request.contextPath}/toUpdate?id=${car.id}">更改</a> |
                            <a href="${pageContext.request.contextPath}/delete/${car.id}">删除</a>
                        </td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </div>
    </div>
    <a href="index.jsp">首页</a>
</div>
</body>
</html>
